package com.taoz.rpc.core.fault.retry;

import com.taoz.rpc.core.model.RpcResponse;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;

@Slf4j
public class NoRetryHelper implements RetryHelper {

    @Override
    public RpcResponse getResultWithRetry(Callable<RpcResponse> callable) {
        try {
            return callable.call();
        } catch (Exception e) {
            log.info("Callable调用异常", e);
            return new RpcResponse();
        }
    }
}
